Skip to main content

Fees

The Zenex fee structure comprises three distinct fees: the base fee, the price impact fee, and the hourly borrowing fee. This document aims to explain the workings and details of these fee components, focusing on their calculation and the rationale behind their implementation. While reading, it is important to keep in mind that all initial parameters might be subject to adjustments by the DAO later on.

1. Base Fee

The base fee is a small fee to be paid for both opening and closing a trade. This fee will initially be set to 0.05% accros all assets, in order to align and be competitive with similar decentralized perpetuals exchanges*. The base fee is applied exclusively to the dominant market side: When long positions exceed short positions, the fee is levied only upon the opening or closing of a long position, and vice versa.

2. Price Impact Fee

The price impact fee is meant to simulate the market impact that large sized notional trades would have on the price in traditional exchanges. Its implementation serves to disincentivize excessive position sizes, since this would add risk for vault depositors. The price impact fee varies per asset, as it depends on the (expected) trading volume of the asset in question. It is computed as follows:

PriceImpactFee = NotionalSize / PriceImpactScalar

The PriceImpactScalar settings for each asset can be found here.

3. Hourly Borrowing Rate (Time-Based Fee)

The hourly borrowing rate is a fee designed to reflect the costs associated with borrowing assets within the protocol. This fee dynamically adjusts based on current market conditions, specifically the ratio between long and short positions on the asset in question.

The initial settings for the base hourly rates can be found here. The way they are subsequently corrected based on market conditions is explained in section 3.1.

3.1 Long/Short Correction

If the notional value of all long positions significantly exceeds that of the shorts (or vice versa), the hourly rate adjusts to incentivize a more balanced market. For example; the more longs dominate, the more negative the hourly rate for shorts becomes, and the more positive the hourly rate for longs becomes. This way users are encouraged to open shorts instead of longs. When the market is extremely one-sided this opens up an arbitrage opportunity for users: they could secure a net profit by entering the subsidized (negative-carry) leg and hedging the opposite risk externally at low cost. Overall this dynamic helps align long and short exposure, reducing risk for the vault.

The hourly rate is adjusted based on the market as shown below. By construction, 80% of positive hourly fees paid by the majority side is rebated to positions on the opposing side, while the remaining 20% serves as yield for the vault depositors (liquidity providers):

If longs > shorts we have:

hourlyRateLong = hourlyRate * (notionalLongs / totalShorts)

hourlyRateShort = - 0.8 * hourlyRate * (notionalLongs / totalShorts)^2

Conversely, when longs < shorts:

hourlyRateLong = - 0.8 * hourlyRate * (notionalShorts / totalLongs)^2

hourlyRateShort = hourlyRate * (notionalShorts / totalLongs)

Furthermore, for edge cases the following applies. If:

notionalLongs = notionalShorts, we have hourlyRateLong = HourlyRateShort = baseHourlyRate

notionalShorts = 0 & notionalLongs =! 0, hourlyRateLong = baseHourlyRate

notionalLongs = 0 & notionalSHorts =! 0, hourlyRateShort = baseHourlyRate

Example: If the notional value of all short positions would be 20, and the notional value of all long positions would be 80, we would have the following hourly rates:

HourlyRateLong = baseHourlyRate * 4

HourlyRateShort = - 0.8 * baseHourlyRate * 16 = - 0.8 * (HourlyRateLong * 4)

5. Total Fee Calculation

Based on all the above components, the total fee is calculated as follows:

If notional longs > notional shorts

TotalFeeLongs = 2 * (BaseFee + PriceImpactFee) + HourlyBorrowingRate * (notionalLongs / totalShorts) * Hours

TotalFeeShorts = 2 * PriceImpactFee - 0.8 *  HourlyBorrowingRate * (notionalLongs / totalShorts)^2 * Hours

If notional longs < notional shorts

TotalFeeLongs = 2 * PriceImpactFee - 0.8 * HourlyBorrowingRate * (notionalShorts / totalLongs)^2 * Hours

TotalFeeShorts = 2 * (BaseFee + PriceImpactFee) + HourlyBorrowingRate * (notionalShorts / totalLongs) * Hours

*Similar base fees (or taker fees) are paid in Jupiter perps, Hyperliquid and GMX.